﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using gestionClinica.Gestion_DB;

namespace gestionClinica
{
    public partial class formHistoriales : Form
    {
        private gestion gest = new gestion();
        public formHistoriales()
        {
            InitializeComponent();
        }

        private void formHistoriales_Load(object sender, EventArgs e)
        {
            grillaHistorialDoctor.DataSource = gest.getHistorialDoctores();
            grillaHistorialDoctor.DataMember = "historialDoctor";
            grillaHistorialPaciente.DataSource = gest.getHistorialPaciente();
            grillaHistorialPaciente.DataMember = "historialPaciente";
            grillaHistorialUnidad.DataSource = gest.getDoctorUnidad();
            grillaHistorialUnidad.DataMember = "UnidadDoctores";
        }

        

        private void eventoteclaPaciente(object sender, EventArgs e)
        {
            grillaHistorialPaciente.DataSource = gest.getHistorialPacienteLike(txtBuscarPaciente.Text.ToUpper());
            grillaHistorialPaciente.DataMember = "historialPaciente";

        }

        private void eventoTeclaUnidad(object sender, EventArgs e)
        {
            grillaHistorialUnidad.DataSource = gest.getDoctorUnidadLike(txtBuscarUnidad.Text.ToUpper());
            grillaHistorialUnidad.DataMember = "UnidadDoctores";
        }

        private void eventoBuscarDoctor(object sender, EventArgs e)
        {
            grillaHistorialDoctor.DataSource = gest.getHistorialDoctoresLike(txtBuscarDoctor.Text.ToUpper());
            grillaHistorialDoctor.DataMember = "historialDoctor";
        }
    }
}
